<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
import="it.polimi.swim.entity.SystemUser, it.polimi.swim.entity.Skill,java.util.ArrayList,java.util.List"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="myStyle.css">
<title>SWIMv2</title>
</head>
<body>
<div id='header' >
	<div style="float:left"><a href="index.jsp">SWIMv2</a></div>
</div>
<div id="content">
<br><br>
<%
if(session.getAttribute("mail")!=null){
	out.println("You are now logged in to SWIMv2");	
}
else{%>
<fieldset class="fieldsetIndex">
	<legend>Sign up to SWIMv2 Project</legend>

<%	out.println("<form method='post' action='RegistrationServlet'>"); 
	
	out.println("Name <br><input type='text' name='name'/><br>");
	out.println("Surname <br><input type='text' name='surname'/><br>"); 
	out.println("Mail <br><input type='text' name='mail'/><br>");
	out.println("Password <br><input type='password' name='psw'/><br>");
	out.println("City <br><input type='text' name='city'/><br>");
	out.println("<br>Date of birth <br>");
	
	
	
	//Select day
	out.println("<select name='day'>");
	for(int i=1; i<32; i++){
		out.println("<option value="+i+">"+i+"</option>");
	}
	out.println("</select>");
	
	//Select month
	
	out.println("<select name='month'>");
	for(int i=1; i<13; i++){
		out.println("<option value="+i+">"+i+"</option>");
	}
	out.println("</select>");
	
	
	//Select year
	out.println("<select name='year'>");
	for(int i=1990; i<2013; i++){
		out.println("<option value="+i+">"+i+"</option>");
	}
	out.println("</select>");
	
List<Skill> skillList= (List<Skill>)request.getAttribute("skillList");
	
	int i = 0;
	for(Skill s:skillList ){
		out.println("<br><input type='checkbox' name='skill' value='"+s.getId()+"'/> " + s.getName());
		i++;
	}
	out.println("<br><br><input value='Sign up' type='submit'>");
	out.println("</form>");
}
%>
</fieldset>
</div>
</body>
</html>